home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / Serious Demos / Symbolic Composer 4.2 / Environment / System / DEF / Library / Retrieve / pick-length < prev    next >
Text File  |  1998-10-23  |  967b  |  12 lines

  1. pick-length template-description &rest template-descriptions
  2.  
  3. The first item in template-description is a path and the file name of the library. The second item is a random generator seed in the range 0.0000-0.9999. If the item is nil, then initialisation is not performed. If the third item is a list, it is evaluated, and the return value is used as a template. If it is an atom, then it and all atoms in the rest template-description list are used as templates. If the names exists in the library, the values associated with them are used, and no randomness takes place. Otherwise the template is filled randomly by mapping template symbols to elements in the active library. The active library is set with (set-length-path foldername).
  4.  
  5. (def-length perc
  6.    (pick-length
  7.       ("test" 0.4 a b a b a b a c a b a b a b a d)
  8.       ("test" 0.635 (use-item definition))
  9.       ("test" nil (use-item (symbol-trim 4 (gen-trans a 3))))
  10.       ("test" nil len1 len2 a)
  11.    )
  12. )